<template>
  <div>
     <ul>
      <li v-for = "(item,index)  in arr" :key = "item">{{item }}<button @click="btnn(index)">删除</button></li>
     </ul>
     <button @click="btn">生成</button>
   </div>
</template>
 
<script>
export default {
  name: "",
  components: {},
  props: {},
  data() {
    return {
      arr: [1,5,3], 
    };
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    btn() {
      this.arr.push(Math.floor(Math.random() * 10))
    },
    btnn(a) {
      this.arr.splice(a,1)
    }
  }
};
</script>

<style scoped>
     
</style>